3.1.2 \(\int \frac {(A+B x) (a+b x+c x^2)^2}{d+f x^2} \, dx\) [2]

3.1.2.1 Optimal result
3.1.2.2 Mathematica [A] (verified)
3.1.2.3 Rubi [A] (verified)
3.1.2.4 Maple [A] (verified)
3.1.2.5 Fricas [A] (verification not implemented)
3.1.2.6 Sympy [B] (verification not implemented)
3.1.2.7 Maxima [A] (verification not implemented)
3.1.2.8 Giac [A] (verification not implemented)
3.1.2.9 Mupad [B] (verification not implemented)

3.1.2.1 Optimal result

Integrand size = 27, antiderivative size = 228 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\frac {\left (A b^2 f-A c (c d-2 a f)-b B (2 c d-2 a f)\right ) x}{f^2}+\frac {\left (2 A b c f-B \left (c^2 d-b^2 f-2 a c f\right )\right ) x^2}{2 f^2}+\frac {c (2 b B+A c) x^3}{3 f}+\frac {B c^2 x^4}{4 f}-\frac {\left (A b^2 d f-2 b B d (c d-a f)-A (c d-a f)^2\right ) \arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d} f^{5/2}}-\frac {\left (2 A b f (c d-a f)-B \left (c^2 d^2-2 a c d f-f \left (b^2 d-a^2 f\right )\right )\right ) \log \left (d+f x^2\right )}{2 f^3} \]

output
(A*b^2*f-A*c*(-2*a*f+c*d)-b*B*(-2*a*f+2*c*d))*x/f^2+1/2*(2*A*b*c*f-B*(-2*a 
*c*f-b^2*f+c^2*d))*x^2/f^2+1/3*c*(A*c+2*B*b)*x^3/f+1/4*B*c^2*x^4/f-1/2*(2* 
A*b*f*(-a*f+c*d)-B*(c^2*d^2-2*a*c*d*f-f*(-a^2*f+b^2*d)))*ln(f*x^2+d)/f^3-( 
A*b^2*d*f-2*b*B*d*(-a*f+c*d)-A*(-a*f+c*d)^2)*arctan(x*f^(1/2)/d^(1/2))/f^( 
5/2)/d^(1/2)
 
3.1.2.2 Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 204, normalized size of antiderivative = 0.89 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\frac {\left (-A b^2 d f+2 b B d (c d-a f)+A (c d-a f)^2\right ) \arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d} f^{5/2}}+\frac {f x \left (12 A b c f x+6 b^2 f (2 A+B x)+3 B c x \left (-2 c d+4 a f+c f x^2\right )+4 A c \left (-3 c d+6 a f+c f x^2\right )+4 b B \left (-6 c d+6 a f+2 c f x^2\right )\right )+6 \left (2 A b f (-c d+a f)+B \left (c^2 d^2-b^2 d f-2 a c d f+a^2 f^2\right )\right ) \log \left (d+f x^2\right )}{12 f^3} \]

input
Integrate[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x]
 
output
((-(A*b^2*d*f) + 2*b*B*d*(c*d - a*f) + A*(c*d - a*f)^2)*ArcTan[(Sqrt[f]*x) 
/Sqrt[d]])/(Sqrt[d]*f^(5/2)) + (f*x*(12*A*b*c*f*x + 6*b^2*f*(2*A + B*x) + 
3*B*c*x*(-2*c*d + 4*a*f + c*f*x^2) + 4*A*c*(-3*c*d + 6*a*f + c*f*x^2) + 4* 
b*B*(-6*c*d + 6*a*f + 2*c*f*x^2)) + 6*(2*A*b*f*(-(c*d) + a*f) + B*(c^2*d^2 
 - b^2*d*f - 2*a*c*d*f + a^2*f^2))*Log[d + f*x^2])/(12*f^3)
 
3.1.2.3 Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 228, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {1345, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx\)

\(\Big \downarrow \) 1345

\(\displaystyle \int \left (\frac {-x \left (2 A b f (c d-a f)-B \left (-f \left (b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )+A (c d-a f)^2+2 b B d (c d-a f)-A b^2 d f}{f^2 \left (d+f x^2\right )}+\frac {x \left (2 A b c f-B \left (-2 a c f+b^2 (-f)+c^2 d\right )\right )}{f^2}+\frac {-A c (c d-2 a f)-b B (2 c d-2 a f)+A b^2 f}{f^2}+\frac {c x^2 (A c+2 b B)}{f}+\frac {B c^2 x^3}{f}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\log \left (d+f x^2\right ) \left (2 A b f (c d-a f)-B \left (-f \left (b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )}{2 f^3}-\frac {\arctan \left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (-A (c d-a f)^2-2 b B d (c d-a f)+A b^2 d f\right )}{\sqrt {d} f^{5/2}}+\frac {x^2 \left (2 A b c f-B \left (-2 a c f+b^2 (-f)+c^2 d\right )\right )}{2 f^2}+\frac {x \left (-A c (c d-2 a f)-b B (2 c d-2 a f)+A b^2 f\right )}{f^2}+\frac {c x^3 (A c+2 b B)}{3 f}+\frac {B c^2 x^4}{4 f}\)

input
Int[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x]
 
output
((A*b^2*f - A*c*(c*d - 2*a*f) - b*B*(2*c*d - 2*a*f))*x)/f^2 + ((2*A*b*c*f 
- B*(c^2*d - b^2*f - 2*a*c*f))*x^2)/(2*f^2) + (c*(2*b*B + A*c)*x^3)/(3*f) 
+ (B*c^2*x^4)/(4*f) - ((A*b^2*d*f - 2*b*B*d*(c*d - a*f) - A*(c*d - a*f)^2) 
*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*f^(5/2)) - ((2*A*b*f*(c*d - a*f) - 
B*(c^2*d^2 - 2*a*c*d*f - f*(b^2*d - a^2*f)))*Log[d + f*x^2])/(2*f^3)
 

3.1.2.3.1 Defintions of rubi rules used

rule 1345
Int[((g_.) + (h_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_)*((d_) + (e_.)*(x_) + (f 
_.)*(x_)^2)^(q_), x_Symbol] :> Int[ExpandIntegrand[(a + c*x^2)^p*(d + e*x + 
 f*x^2)^q*(g + h*x), x], x] /; FreeQ[{a, c, d, e, f, g, h}, x] && NeQ[e^2 - 
 4*d*f, 0] && IntegersQ[p, q] && (GtQ[p, 0] || GtQ[q, 0])
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
3.1.2.4 Maple [A] (verified)

Time = 0.73 (sec) , antiderivative size = 235, normalized size of antiderivative = 1.03

method result size
default \(\frac {\frac {1}{4} B \,c^{2} x^{4} f +\frac {1}{3} A \,c^{2} f \,x^{3}+\frac {2}{3} B b c f \,x^{3}+A b c f \,x^{2}+B a c f \,x^{2}+\frac {1}{2} B \,b^{2} f \,x^{2}-\frac {1}{2} B \,c^{2} d \,x^{2}+2 A a c f x +A \,b^{2} f x -A \,c^{2} d x +2 B a b f x -2 B b c d x}{f^{2}}+\frac {\frac {\left (2 A a b \,f^{2}-2 A b c d f +B \,a^{2} f^{2}-2 B a c d f -B \,b^{2} d f +B \,c^{2} d^{2}\right ) \ln \left (f \,x^{2}+d \right )}{2 f}+\frac {\left (A \,a^{2} f^{2}-2 A a c d f -A \,b^{2} d f +A \,c^{2} d^{2}-2 B a b d f +2 c \,d^{2} B b \right ) \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}}}{f^{2}}\) \(235\)
risch \(\text {Expression too large to display}\) \(1943\)

input
int((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x,method=_RETURNVERBOSE)
 
output
1/f^2*(1/4*B*c^2*x^4*f+1/3*A*c^2*f*x^3+2/3*B*b*c*f*x^3+A*b*c*f*x^2+B*a*c*f 
*x^2+1/2*B*b^2*f*x^2-1/2*B*c^2*d*x^2+2*A*a*c*f*x+A*b^2*f*x-A*c^2*d*x+2*B*a 
*b*f*x-2*B*b*c*d*x)+1/f^2*(1/2*(2*A*a*b*f^2-2*A*b*c*d*f+B*a^2*f^2-2*B*a*c* 
d*f-B*b^2*d*f+B*c^2*d^2)/f*ln(f*x^2+d)+(A*a^2*f^2-2*A*a*c*d*f-A*b^2*d*f+A* 
c^2*d^2-2*B*a*b*d*f+2*B*b*c*d^2)/(d*f)^(1/2)*arctan(f*x/(d*f)^(1/2)))
 
3.1.2.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 500, normalized size of antiderivative = 2.19 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\left [\frac {3 \, B c^{2} d f^{2} x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} d f^{2} x^{3} - 6 \, {\left (B c^{2} d^{2} f - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f^{2}\right )} x^{2} - 6 \, {\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \sqrt {-d f} \log \left (\frac {f x^{2} - 2 \, \sqrt {-d f} x - d}{f x^{2} + d}\right ) - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d^{2} f - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f^{2}\right )} x + 6 \, {\left (B c^{2} d^{3} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d^{2} f + {\left (B a^{2} + 2 \, A a b\right )} d f^{2}\right )} \log \left (f x^{2} + d\right )}{12 \, d f^{3}}, \frac {3 \, B c^{2} d f^{2} x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} d f^{2} x^{3} - 6 \, {\left (B c^{2} d^{2} f - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f^{2}\right )} x^{2} + 12 \, {\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \sqrt {d f} \arctan \left (\frac {\sqrt {d f} x}{d}\right ) - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d^{2} f - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f^{2}\right )} x + 6 \, {\left (B c^{2} d^{3} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d^{2} f + {\left (B a^{2} + 2 \, A a b\right )} d f^{2}\right )} \log \left (f x^{2} + d\right )}{12 \, d f^{3}}\right ] \]

input
integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="fricas")
 
output
[1/12*(3*B*c^2*d*f^2*x^4 + 4*(2*B*b*c + A*c^2)*d*f^2*x^3 - 6*(B*c^2*d^2*f 
- (B*b^2 + 2*(B*a + A*b)*c)*d*f^2)*x^2 - 6*(A*a^2*f^2 + (2*B*b*c + A*c^2)* 
d^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f)*sqrt(-d*f)*log((f*x^2 - 2*sqrt(-d*f 
)*x - d)/(f*x^2 + d)) - 12*((2*B*b*c + A*c^2)*d^2*f - (2*B*a*b + A*b^2 + 2 
*A*a*c)*d*f^2)*x + 6*(B*c^2*d^3 - (B*b^2 + 2*(B*a + A*b)*c)*d^2*f + (B*a^2 
 + 2*A*a*b)*d*f^2)*log(f*x^2 + d))/(d*f^3), 1/12*(3*B*c^2*d*f^2*x^4 + 4*(2 
*B*b*c + A*c^2)*d*f^2*x^3 - 6*(B*c^2*d^2*f - (B*b^2 + 2*(B*a + A*b)*c)*d*f 
^2)*x^2 + 12*(A*a^2*f^2 + (2*B*b*c + A*c^2)*d^2 - (2*B*a*b + A*b^2 + 2*A*a 
*c)*d*f)*sqrt(d*f)*arctan(sqrt(d*f)*x/d) - 12*((2*B*b*c + A*c^2)*d^2*f - ( 
2*B*a*b + A*b^2 + 2*A*a*c)*d*f^2)*x + 6*(B*c^2*d^3 - (B*b^2 + 2*(B*a + A*b 
)*c)*d^2*f + (B*a^2 + 2*A*a*b)*d*f^2)*log(f*x^2 + d))/(d*f^3)]
 
3.1.2.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 933 vs. \(2 (209) = 418\).

Time = 15.56 (sec) , antiderivative size = 933, normalized size of antiderivative = 4.09 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\frac {B c^{2} x^{4}}{4 f} + x^{3} \left (\frac {A c^{2}}{3 f} + \frac {2 B b c}{3 f}\right ) + x^{2} \left (\frac {A b c}{f} + \frac {B a c}{f} + \frac {B b^{2}}{2 f} - \frac {B c^{2} d}{2 f^{2}}\right ) + x \left (\frac {2 A a c}{f} + \frac {A b^{2}}{f} - \frac {A c^{2} d}{f^{2}} + \frac {2 B a b}{f} - \frac {2 B b c d}{f^{2}}\right ) + \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} - \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right ) \log {\left (x + \frac {- 2 A a b d f^{2} + 2 A b c d^{2} f - B a^{2} d f^{2} + 2 B a c d^{2} f + B b^{2} d^{2} f - B c^{2} d^{3} + 2 d f^{3} \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} - \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right )}{A a^{2} f^{3} - 2 A a c d f^{2} - A b^{2} d f^{2} + A c^{2} d^{2} f - 2 B a b d f^{2} + 2 B b c d^{2} f} \right )} + \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} + \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right ) \log {\left (x + \frac {- 2 A a b d f^{2} + 2 A b c d^{2} f - B a^{2} d f^{2} + 2 B a c d^{2} f + B b^{2} d^{2} f - B c^{2} d^{3} + 2 d f^{3} \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} + \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right )}{A a^{2} f^{3} - 2 A a c d f^{2} - A b^{2} d f^{2} + A c^{2} d^{2} f - 2 B a b d f^{2} + 2 B b c d^{2} f} \right )} \]

input
integrate((B*x+A)*(c*x**2+b*x+a)**2/(f*x**2+d),x)
 
output
B*c**2*x**4/(4*f) + x**3*(A*c**2/(3*f) + 2*B*b*c/(3*f)) + x**2*(A*b*c/f + 
B*a*c/f + B*b**2/(2*f) - B*c**2*d/(2*f**2)) + x*(2*A*a*c/f + A*b**2/f - A* 
c**2*d/f**2 + 2*B*a*b/f - 2*B*b*c*d/f**2) + ((2*A*a*b*f**2 - 2*A*b*c*d*f + 
 B*a**2*f**2 - 2*B*a*c*d*f - B*b**2*d*f + B*c**2*d**2)/(2*f**3) - sqrt(-d* 
f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A*b**2*d*f + A*c**2*d**2 - 2*B*a*b*d*f 
+ 2*B*b*c*d**2)/(2*d*f**6))*log(x + (-2*A*a*b*d*f**2 + 2*A*b*c*d**2*f - B* 
a**2*d*f**2 + 2*B*a*c*d**2*f + B*b**2*d**2*f - B*c**2*d**3 + 2*d*f**3*((2* 
A*a*b*f**2 - 2*A*b*c*d*f + B*a**2*f**2 - 2*B*a*c*d*f - B*b**2*d*f + B*c**2 
*d**2)/(2*f**3) - sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A*b**2*d*f + 
A*c**2*d**2 - 2*B*a*b*d*f + 2*B*b*c*d**2)/(2*d*f**6)))/(A*a**2*f**3 - 2*A* 
a*c*d*f**2 - A*b**2*d*f**2 + A*c**2*d**2*f - 2*B*a*b*d*f**2 + 2*B*b*c*d**2 
*f)) + ((2*A*a*b*f**2 - 2*A*b*c*d*f + B*a**2*f**2 - 2*B*a*c*d*f - B*b**2*d 
*f + B*c**2*d**2)/(2*f**3) + sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A* 
b**2*d*f + A*c**2*d**2 - 2*B*a*b*d*f + 2*B*b*c*d**2)/(2*d*f**6))*log(x + ( 
-2*A*a*b*d*f**2 + 2*A*b*c*d**2*f - B*a**2*d*f**2 + 2*B*a*c*d**2*f + B*b**2 
*d**2*f - B*c**2*d**3 + 2*d*f**3*((2*A*a*b*f**2 - 2*A*b*c*d*f + B*a**2*f** 
2 - 2*B*a*c*d*f - B*b**2*d*f + B*c**2*d**2)/(2*f**3) + sqrt(-d*f**7)*(A*a* 
*2*f**2 - 2*A*a*c*d*f - A*b**2*d*f + A*c**2*d**2 - 2*B*a*b*d*f + 2*B*b*c*d 
**2)/(2*d*f**6)))/(A*a**2*f**3 - 2*A*a*c*d*f**2 - A*b**2*d*f**2 + A*c**2*d 
**2*f - 2*B*a*b*d*f**2 + 2*B*b*c*d**2*f))
 
3.1.2.7 Maxima [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 220, normalized size of antiderivative = 0.96 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\frac {{\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{2}} + \frac {3 \, B c^{2} f x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} f x^{3} - 6 \, {\left (B c^{2} d - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} f\right )} x^{2} - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} f\right )} x}{12 \, f^{2}} + \frac {{\left (B c^{2} d^{2} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f + {\left (B a^{2} + 2 \, A a b\right )} f^{2}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{3}} \]

input
integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="maxima")
 
output
(A*a^2*f^2 + (2*B*b*c + A*c^2)*d^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f)*arct 
an(f*x/sqrt(d*f))/(sqrt(d*f)*f^2) + 1/12*(3*B*c^2*f*x^4 + 4*(2*B*b*c + A*c 
^2)*f*x^3 - 6*(B*c^2*d - (B*b^2 + 2*(B*a + A*b)*c)*f)*x^2 - 12*((2*B*b*c + 
 A*c^2)*d - (2*B*a*b + A*b^2 + 2*A*a*c)*f)*x)/f^2 + 1/2*(B*c^2*d^2 - (B*b^ 
2 + 2*(B*a + A*b)*c)*d*f + (B*a^2 + 2*A*a*b)*f^2)*log(f*x^2 + d)/f^3
 
3.1.2.8 Giac [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 263, normalized size of antiderivative = 1.15 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=\frac {{\left (2 \, B b c d^{2} + A c^{2} d^{2} - 2 \, B a b d f - A b^{2} d f - 2 \, A a c d f + A a^{2} f^{2}\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{2}} + \frac {{\left (B c^{2} d^{2} - B b^{2} d f - 2 \, B a c d f - 2 \, A b c d f + B a^{2} f^{2} + 2 \, A a b f^{2}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{3}} + \frac {3 \, B c^{2} f^{3} x^{4} + 8 \, B b c f^{3} x^{3} + 4 \, A c^{2} f^{3} x^{3} - 6 \, B c^{2} d f^{2} x^{2} + 6 \, B b^{2} f^{3} x^{2} + 12 \, B a c f^{3} x^{2} + 12 \, A b c f^{3} x^{2} - 24 \, B b c d f^{2} x - 12 \, A c^{2} d f^{2} x + 24 \, B a b f^{3} x + 12 \, A b^{2} f^{3} x + 24 \, A a c f^{3} x}{12 \, f^{4}} \]

input
integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="giac")
 
output
(2*B*b*c*d^2 + A*c^2*d^2 - 2*B*a*b*d*f - A*b^2*d*f - 2*A*a*c*d*f + A*a^2*f 
^2)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f^2) + 1/2*(B*c^2*d^2 - B*b^2*d*f - 2 
*B*a*c*d*f - 2*A*b*c*d*f + B*a^2*f^2 + 2*A*a*b*f^2)*log(f*x^2 + d)/f^3 + 1 
/12*(3*B*c^2*f^3*x^4 + 8*B*b*c*f^3*x^3 + 4*A*c^2*f^3*x^3 - 6*B*c^2*d*f^2*x 
^2 + 6*B*b^2*f^3*x^2 + 12*B*a*c*f^3*x^2 + 12*A*b*c*f^3*x^2 - 24*B*b*c*d*f^ 
2*x - 12*A*c^2*d*f^2*x + 24*B*a*b*f^3*x + 12*A*b^2*f^3*x + 24*A*a*c*f^3*x) 
/f^4
 
3.1.2.9 Mupad [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 253, normalized size of antiderivative = 1.11 \[ \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx=x\,\left (\frac {A\,b^2+2\,B\,a\,b+2\,A\,a\,c}{f}-\frac {d\,\left (A\,c^2+2\,B\,b\,c\right )}{f^2}\right )+x^2\,\left (\frac {B\,b^2+2\,A\,c\,b+2\,B\,a\,c}{2\,f}-\frac {B\,c^2\,d}{2\,f^2}\right )+\frac {x^3\,\left (A\,c^2+2\,B\,b\,c\right )}{3\,f}+\frac {B\,c^2\,x^4}{4\,f}+\frac {\mathrm {atan}\left (\frac {\sqrt {f}\,x}{\sqrt {d}}\right )\,\left (A\,a^2\,f^2-2\,B\,a\,b\,d\,f-2\,A\,a\,c\,d\,f-A\,b^2\,d\,f+2\,B\,b\,c\,d^2+A\,c^2\,d^2\right )}{\sqrt {d}\,f^{5/2}}+\frac {\ln \left (f\,x^2+d\right )\,\left (4\,B\,a^2\,d\,f^5+8\,A\,a\,b\,d\,f^5-8\,B\,a\,c\,d^2\,f^4-4\,B\,b^2\,d^2\,f^4-8\,A\,b\,c\,d^2\,f^4+4\,B\,c^2\,d^3\,f^3\right )}{8\,d\,f^6} \]

input
int(((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x)
 
output
x*((A*b^2 + 2*A*a*c + 2*B*a*b)/f - (d*(A*c^2 + 2*B*b*c))/f^2) + x^2*((B*b^ 
2 + 2*A*b*c + 2*B*a*c)/(2*f) - (B*c^2*d)/(2*f^2)) + (x^3*(A*c^2 + 2*B*b*c) 
)/(3*f) + (B*c^2*x^4)/(4*f) + (atan((f^(1/2)*x)/d^(1/2))*(A*a^2*f^2 + A*c^ 
2*d^2 + 2*B*b*c*d^2 - A*b^2*d*f - 2*A*a*c*d*f - 2*B*a*b*d*f))/(d^(1/2)*f^( 
5/2)) + (log(d + f*x^2)*(4*B*a^2*d*f^5 - 4*B*b^2*d^2*f^4 + 4*B*c^2*d^3*f^3 
 + 8*A*a*b*d*f^5 - 8*A*b*c*d^2*f^4 - 8*B*a*c*d^2*f^4))/(8*d*f^6)